<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>测试校验</title>
</head>
<body>

<p>在文本框中尝试输入触发函数。</p>
	<input type="text" id="myInput" oninput="myFunction()">
<p id="demo"></p>
<script>
function myFunction() {
    var x = document.getElementById("myInput").value;
    document.getElementById("demo").innerHTML = "你输入的是: " + x;
}
</script>

</body>
</html>